<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var o = [1,2,3];
        var max = 0;
        o.forEach(function(value){
            if(value > max){
                max = value;
            }
        });
        console.log(max);
    </script>
</body>
</html>